Why is the jQuery variable 'y' returning undefined when trying to select a matching li by id